﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CommonApp
{
    public class PagingHelper
    {
        public static IList<T> Paging<T>(Func<Func<T, bool>, int?, IList<T>> select, Func<T, bool> criteria, int page, out int totalCount)
        {
            totalCount = select(criteria, null).Count;
            return select(criteria, page);
        }
    }
}
